<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>专家信息管理</title>
	<script src="../../js/header.js"></script>
	<style type="text/css">
		html, body, #expertmessage {
			padding: 0px;
			margin: 0px;

		}
		#expertmessage{
			border-top: 3px solid #0D9AFF;
			padding: 25px;
		}
		.tab-title{
			font-size: 16px;
			font-weight: bold;
			border-left: 4px solid #0D9AFF;
			font-family: PingFangSC-Medium;
			padding-left:10px;
			margin-bottom: 20px;
		}
		.el-dialog__footer {
			padding: 10px 20px 20px;
			text-align: center;
			-webkit-box-sizing: border-box;
			box-sizing: border-box;
		}
		.el-dialog__body {
			color: rgb(96, 98, 102);
			font-size: 14px;
			word-break: break-all;
			padding: 0px 20px;
		}
		#excel {
			display: none;
		}
		.el-input__inner {
			-webkit-appearance: none;
			background-color: #FFF;
			background-image: none;
			border-radius: 4px;
			border: 1px solid #DCDFE6;
			-webkit-box-sizing: border-box;
			box-sizing: border-box;
			color: #606266;
			display: inline-block;
			font-size: inherit;
			height: 30px;
			line-height: 30px;
			outline: 0;
			padding: 0 15px;
			-webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
			transition: border-color .2s cubic-bezier(.645,.045,.355,1);
		}
		/*#expertmessage .el-input,
		#expertmessage .el-select,
		#expertmessage .el-input-number{
			width: 100%;
		}*/
		.listed .el-form-item__label{
			letter-spacing: 3px;
		}
		.el-textarea {
			width: 95%;
		}

		/* 搜索按钮样式修改 */
		#expertmessage .el-button.is-circle.search_btn{
			position: absolute;
			right: 0;
			top: 0;
			border: 0;
			background: none;
		}
		#expertmessage .el-button.is-circle.search_btn i{
			font-size: 17px;
		}
	</style>
</head>

<body>
<div v-cloak id="expertmessage">
	<div style="margin-top: 10px;">
		<div style="margin-top: 10px;border-bottom:1px solid rgba(200,200,200,0.43);">
			<el-form :model="selectForm" :rules="rules" ref="selectForm" label-width="150px">
				<el-row>
					<el-col :span="8">
						<el-form-item label="专家姓名:" prop="" label-width="110px">
							<el-input v-model="selectForm.expertName" placeholder="专家姓名" style="width: 380px;"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="证件号码:" prop="" label-width="140px">
							<el-input v-model="selectForm.expertIdcard" placeholder="证件号码" style="width: 280px;"></el-input>
						</el-form-item>
					</el-col>
					<el-col span="6">
						<el-form-item label="专家等级:" label-width="160px">
							<el-select v-model="selectForm.expertLevl" placeholder="请选择专家等级" style="width: 280px;">
								<el-option label="省级" value="1"></el-option>
								<el-option label="国家" value="2"></el-option>
							</el-select>
						</el-form-item>
					</el-col>
				</el-row>

				<el-row>
					<el-col :span="6">
						<el-form-item label="联系方式:" label-width="110px">
							<el-input v-model="selectForm.expertTel" placeholder="请输入联系方式" style="width: 280px"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="8">
						<el-form-item label="工作时间:" label-width="110px" >
                            <el-col span="6" style="width: 180px;">
                                <el-form-item prop="startTime">
                                    <el-date-picker
                                            v-model="selectForm.startTime"
                                            type="date"
                                            value-format="yyyy-MM-dd"
                                            placeholder="选择开始时间"
                                            style="width: 180px;">
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                            <el-col span="1" style="color: rgb(192, 204, 218);text-align: center;">
                                <span>—</span>
                            </el-col>
                            <el-col :span="6" style="">
                                    <el-form-item prop="endTime">
                                        <el-date-picker
                                                v-model="selectForm.endTime"
                                                type="date"
                                                value-format="yyyy-MM-dd"
                                                placeholder="选择结束时间"
                                                style="width: 180px;">
                                        </el-date-picker>
                                    </el-form-item>
                            </el-col>
					    </el-form-item>
					</el-col>

                    <el-col :span="6">
                        <el-form-item label="是否在黑名单:" label-width="140px">
                            <el-select v-model="selectForm.isBlackList" placeholder="请选择是否在黑名单" style="width: 280px;">
                                <el-option label="否" value="0"></el-option>
                                <el-option label="是" value="1"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
				</el-row>
				<el-row style="margin-bottom: 30px;">
					<div style="float: right;">
						<el-button type="primary" size="small" style="width: 60px;height: 30px;" @click="apply()">申请</el-button>
						<el-button type="primary" size="small" style="width: 60px;height: 30px;" @click="searchForm('selectForm')">查询</el-button>
						<el-button type="warning" size="small" style="width: 60px;height: 30px;" @click="resetForm('selectForm')">重置</el-button>
						<el-button type="primary" size="small" style="height: 30px;" @click="toExtract()">抽取专家</el-button>
						<el-button type="primary" size="small" style="height: 30px;" @click="toExtractList()">查看抽取专家</el-button>
					</div>
				</el-row>
			</el-form>
		</div>

		<el-table :data="tableData" border style="width: 100%;margin-top: 35px;" :header-cell-style="{background:'#eef1f6',color:'#606266'}">
			<el-table-column type="selection" ></el-table-column>
			<el-table-column
					prop="expertName"
					label="专家姓名"
					width="150"
					align="center" >
			</el-table-column>
			<el-table-column
					prop="expertSex"
					label="性别"
					width="100"
					align="center">
				<template scope="scope">
					<span v-if="scope.row.expertSex==1">男</span>
					<span v-if="scope.row.expertSex==2">女</span>
				</template>
			</el-table-column>
			<el-table-column
					prop="major"
					label="专业类型"
					width="180"
					align="center">
				<template scope="scope">
					<span v-if="scope.row.major==0">地震学</span>
					<span v-if="scope.row.major==1">地震地质学</span>
					<span v-if="scope.row.major==2">地震工程学</span>
				</template>
			</el-table-column>
			<el-table-column
					prop="expertTel"
					label="联系方式"
					width="200"
					align="center">
			</el-table-column>
			<el-table-column
					prop="expertIdcard"
					label="证件号码"
					width="200"
					align="center">
			</el-table-column>
			<el-table-column
					prop="workTime"
					label="工作时间"
					width="200"
					align="center">
			</el-table-column>
            <el-table-column
                    prop="isBlackList"
                    label="是否在黑名单"
                    width="120"
                    align="center">
                <template scope="scope">
                    <span v-if="scope.row.isBlackList==0">否</span>
                    <span v-if="scope.row.isBlackList==1">是</span>
                    <span v-if="scope.row.isBlackList==2">初始</span>
                </template>
            </el-table-column>
			<el-table-column
					label="操作"
					width=""
					align="center">
				<template slot-scope="scope">
					<el-button type="" size="mini" @click="view(scope.$index,scope.row)">查看</el-button>
					<el-button type="primary" size="mini" @click="edit(scope.$index,scope.row)">修改</el-button>
					<el-button type="danger" size="mini" @click="del(scope.$index,scope.row)">删除</el-button>
				</template>
			</el-table-column>
		</el-table>
		<div style="overflow: hidden;">
			<div class="pagination">
				<el-pagination
						@size-change="handleSizeChange"
						@current-change="handleCurrentChange"
						:current-page="currentPage"
						:page-sizes="[10, 20, 30, 40]"
						:page-size="pagesize"
						background
						layout="total, sizes,prev, pager, next"
						:total="tableTotal"
						prev-text="上一页"
						next-text="下一页">
				</el-pagination>
			</div>
		</div>

		<el-dialog title="" :visible.sync="dialogForm" center fullscreen>
			<div style="margin-top: 10px;">
				<el-form :model="expertmessage" :rules="rules" ref="expertmessage" label-width="140px">
					<!--专家信息表-->
					<el-row>
						<el-col :span="4" class="tab-title">
							专家信息表
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="6">
							<el-form-item label="专家姓名:" prop="expertName">
								<el-input v-model="expertmessage.expertName" placeholder="" :disabled="formDisabled"></el-input>
							</el-form-item>
						</el-col>
						<el-col span="6">
							<el-form-item label="性别:" prop="expertSex">
								<el-select v-model="expertmessage.expertSex" placeholder="请选择性别" :disabled="formDisabled">
									<el-option label="男" value="1"></el-option>
									<el-option label="女" value="2"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
                        <el-col span="6">
                            <el-form-item label="行业标准:" prop="lineStandard">
                                <el-input v-model="expertmessage.lineStandard" placeholder="" :disabled="formDisabled"></el-input>
                            </el-form-item>
                        </el-col>
					</el-row>
					<el-row>
						<el-col span="6">
							<el-form-item label="证件类型:" prop="certype">
								<el-select v-model="expertmessage.certype" placeholder="请选择证件类型" :disabled="formDisabled" @change="changeIdcardRule">
									<el-option label="居民身份证" value="111"></el-option>
									<el-option label="临时居民身份证" value="112"></el-option>
									<el-option label="户口簿" value="113"></el-option>
									<el-option label="中国人民解放军军官证" value="114"></el-option>
									<el-option label="中国人民武警警察部队警官证" value="115"></el-option>
									<el-option label="出生医学证明" value="117"></el-option>
									<el-option label="中国人民解放军士兵证" value="118"></el-option>
									<el-option label="中国人民武警警察部队士兵证" value="119"></el-option>
									<el-option label="中国人民解放军文职人员证" value="120"></el-option>
									<el-option label="中国人民武装警察部队文职人员证" value="122"></el-option>
									<el-option label="居住证" value="154"></el-option>
									<el-option label="外交护照" value="411"></el-option>
									<el-option label="公务护照" value="412"></el-option>
									<el-option label="公务普通护照" value="413"></el-option>
									<el-option label="普通护照" value="414"></el-option>
									<el-option label="旅行证" value="415"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="证件号码:" ref="expertIdcard" prop="expertIdcard" :refs="rules.expertIdcard" style="position: relative;">
								<el-input v-model="expertmessage.expertIdcard" placeholder="" :maxlength="50" show-word-limit :disabled="formDisabled"></el-input>
							</el-form-item>
						</el-col>
                        <el-col :span="6">
                            <el-form-item label="联系方式:"  prop="expertTel" style="position: relative;">
                                <el-input v-model="expertmessage.expertTel" placeholder="" :disabled="formDisabled"></el-input>
                            </el-form-item>
                        </el-col>
					</el-row>
					<el-row>
						<el-col :span="6">
							<el-form-item label="专家等级:" prop="expertLevl">
								<el-select v-model="expertmessage.expertLevl" placeholder="请选择专家等级" :disabled="formDisabled">
									<el-option label="省级" value="1"></el-option>
									<el-option label="国家" value="2"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="专业类型:" prop="major">
								<el-select v-model="expertmessage.major" placeholder="请选择专业类型" :disabled="formDisabled">
									<el-option label="地震学" value="0"></el-option>
									<el-option label="地震地质学" value="1"></el-option>
									<el-option label="地震工程学" value="2"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
                        <el-col :span="6">
                            <el-form-item label="行业类别:" prop="lineType" style="position: relative;">
                                <el-input v-model="expertmessage.lineType" placeholder="" :disabled="formDisabled"></el-input>
                            </el-form-item>
                        </el-col>
					</el-row>
					<el-row>
						<el-col :span="6">
							<el-form-item label="工作单位名称:" prop="unitName">
								<el-input v-model="expertmessage.unitName" placeholder="填写单位名称" :disabled="formDisabled"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="工作单位统一社会信用代码:" prop="unitCode">
								<el-input v-model="expertmessage.unitCode" placeholder="工作单位统一社会信用代码" :disabled="formDisabled"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="参加工作时间:" prop="workTime">
								<el-date-picker
										v-model="expertmessage.workTime"
										:disabled="formDisabled"
										type="date"
										placeholder="选择工作时间">
								</el-date-picker>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="24">
							<el-form-item label="单位所在地:" v-model="expertmessage.unitAddress" style="letter-spacing: 1.2px;" prop="unitAddress">
								<el-select v-model="provinceValue" prop="provinceValue" placeholder="请选择省" @change="chooseProvince" style="width: 150px;" :disabled="formDisabled">
									<el-option
											v-for="item in provinceData"
											:key="item.code"
											:label="item.name"
											:value="item.name">
									</el-option>
								</el-select>
								<span style="color: #C0CCDA;;">—</span>
								<el-select v-model="cityValue"  prop="cityValue" placeholder="请选择市" @change="chooseCity" style="width: 150px;" :disabled="formDisabled">
									<el-option
											v-for="item in cityData"
											:key="item.code"
											:label="item.name"
											:value="item.name">
									</el-option>
								</el-select>
								<span style="color: #C0CCDA;;">—</span>
								<el-select v-model="areaValue"  prop="areaValue" @change="chooseArea" placeholder="请选择区、县" style="width: 150px;" :disabled="formDisabled">
									<el-option
											v-for="item in areaData"
											:key="item.code"
											:label="item.name"
											:value="item.name">
									</el-option>
								</el-select>
								<span style="color: #C0CCDA;;">—</span>
								<el-input v-model="detailAddress" placeholder="填写详细地址" :disabled="formDisabled" style="width: 250px;"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="12">
							<el-form-item label="家庭住址:" prop="expertAddress" style="position: relative;">
								<el-input v-model="expertmessage.expertAddress" placeholder="" :disabled="formDisabled"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col span="22">
							<el-form-item label="专家资历:" prop="expertSeniority">
								<iframe id="viewFrame" style="overflow:hidden;height:200px;width:100%;" width="100%" frameBorder="0"
										:src="link"></iframe>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22">
							<div style="float:right;">
								<el-button v-show="showOnSubmit" type="primary" size="small" style="width: 60px;height: 30px;" @click="onSubmit('expertmessage')">提交</el-button>
								<el-button v-show="showOnReplace" type="primary" size="small" style="width: 60px;height: 30px;" @click="onReplace('expertmessage')">修改</el-button>
								<el-button type="info" size="small" style="width: 60px;height: 30px;" @click="dialogForm = false;clearForm()">取消</el-button>
							</div>
						</el-col>
					</el-row>

				</el-form>
			</div>
		</el-dialog>

		<!-- 专家抽取信息表 - 抽取 -->
		<el-dialog title="" :visible.sync="dialogExpertForm" center fullscreen>
			<div style="margin-top: 10px;">

				<el-form :model="expertForm" :rules="extractrules" ref="expertForm" label-width="140px">
					<!--抽取专家信息表-->
					<el-row>
						<el-col :span="4" class="tab-title">
							抽取专家信息表
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="20">
							<el-form-item label="标题:" prop="title">
								<el-input v-model="expertForm.title" placeholder="" :disabled="expertFormDisabled"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
				<div>
					<el-button type="danger" v-show="showAddExpert" @click="add">新增抽取条件</el-button>
					<el-button type="danger" v-show="showExpertExtract" @click="expertExtract">抽取</el-button>
					<el-form id="table-form" :prop="form" ref="form" :rules="extractrules" :model="form">
						<el-table ref="table" :data="form.expertTableData" border>
							<el-table-column>
								<template slot="header">
									<p>
										专业
										<span style="color:red;font-size:16px;">*</span>
									</p >
								</template>
								<template slot-scope="scope">
									<el-form-item :prop=" 'expertTableData.' + scope.$index + '.major' " :rules="extractrules.major">
										<el-select v-model="scope.row.major" placeholder="请选择专业" @keyup.native.enter="nextFocus($event,scope.row)" :disabled="expertFormDisabled">
											<el-option label="地震学" value="0"></el-option>
											<el-option label="地震地质学" value="1"></el-option>
											<el-option label="地震工程学" value="2"></el-option>
										</el-select>
										<!--<el-input v-model="scope.row.major" @keyup.native.enter="nextFocus($event,scope.row)"></el-input>-->
									</el-form-item>
								</template>
							</el-table-column>
							<el-table-column>
								<template slot="header">
									<p>
										国家级抽取比例
										<span style="color:red;font-size:16px;">*</span>
									</p >
								</template>
								<template slot-scope="scope">
									<el-form-item :prop=" 'expertTableData.' + scope.$index + '.countryRatio' " :rules="extractrules.countryRatio">
										<el-input
												v-model.number="scope.row.countryRatio"
												type="number"
												:disabled="expertFormDisabled"
												@keyup.native.enter="nextFocus($event,scope.row)"
												style="width: 90%; margin-right: 4px;"
										></el-input>%
									</el-form-item>
								</template>
							</el-table-column>
							<el-table-column v-if="extractOrgName == '中国'">
								<template slot="header">
									<p>
										省级抽取比例
										<span style="color:red;font-size:16px;">*</span>
									</p >
								</template>
								<template slot-scope="scope">
									<el-form-item :prop=" 'expertTableData.' + scope.$index + '.provinceRatio' " :rules="extractrules.provinceRatio" >
										<el-input
												v-model.number="scope.row.provinceRatio"
												type="number"
												:disabled="expertFormDisabled"
												@keyup.native.enter="nextFocus($event,scope.row)"
												style="width: 90%; margin-right: 4px;"
										></el-input>%
									</el-form-item>
								</template>
							</el-table-column>
							<template v-else>
								<el-table-column>
									<template slot="header">
										<p>
											省内抽取比例
											<span style="color:red;font-size:16px;">*</span>
										</p >
									</template>
									<template slot-scope="scope">
										<el-form-item :prop=" 'expertTableData.' + scope.$index + '.provinceRatio' " :rules="extractrules.provinceRatio">
											<el-input
													v-model.number="scope.row.provinceRatio"
													type="number"
													:disabled="expertFormDisabled"
													@keyup.native.enter="nextFocus($event,scope.row)"
													style="width: 90%; margin-right: 4px;"
											></el-input>%
										</el-form-item>
									</template>
								</el-table-column>
								<el-table-column>
									<template slot="header">
										<p>
											省外抽取比例
											<span style="color:red;font-size:16px;">*</span>
										</p>
									</template>
									<template slot-scope="scope">
										<el-form-item :prop=" 'expertTableData.' + scope.$index + '.outProvinceRatio' " :rules="extractrules.outProvinceRatio">
											<el-input
													v-model.number="scope.row.outProvinceRatio"
													type="number"
													:disabled="expertFormDisabled"
													@keyup.native.enter="nextFocus($event,scope.row)"
													style="width: 90%; margin-right: 4px;"
											></el-input>%
										</el-form-item>
									</template>
								</el-table-column>
							</template>
							<el-table-column >
								<template slot="header">
									<p>
										抽取人数
										<span style="color:red;font-size:16px;">*</span>
									</p >
								</template>
								<template slot-scope="scope">
									<el-form-item :prop=" 'expertTableData.' + scope.$index + '.regulatoryNum' " :rules="extractrules.regulatoryNum">
										<el-input
												v-model.number="scope.row.regulatoryNum"
												:disabled="expertFormDisabled"
												type="number"
												@keyup.native.enter="nextFocus($event,scope.row)"
										></el-input>
									</el-form-item>
								</template>
							</el-table-column>
							<el-table-column>
								<template slot="header">
									<p>
										操作
									</p >
								</template>
								<template slot-scope="scope">
									<el-button type="danger" icon="el-icon-delete" @click="delExtract(scope.$index)">删除</el-button>
								</template>
							</el-table-column>
						</el-table>
					</el-form>
				</div>

				<el-table :data="expertData" border style="width: 100%;margin-top: 35px;" :header-cell-style="{background:'#eef1f6',color:'#606266'}">
					<el-table-column type="selection" ></el-table-column>
					<el-table-column
							prop="expertName"
							label="专家姓名"
							width="200"
							align="center">
					</el-table-column>
					<el-table-column
							prop="major"
							label="专业"
							width="200"
							align="center">
						<template scope="scope">
							<span v-if="scope.row.major==0">地震学</span>
							<span v-if="scope.row.major==1">地震地质学</span>
							<span v-if="scope.row.major==2">地震工程学</span>
						</template>
					</el-table-column>
					<el-table-column
							prop="expertTel"
							label="联系方式"
							width="200"
							align="center">
					</el-table-column>
					<el-table-column
							prop="expertLevl"
							label="专家等级"
							width="120"
							align="center">
						<template scope="scope">
							<span v-if="scope.row.expertLevl==0">地方</span>
							<span v-if="scope.row.expertLevl==1">省级</span>
							<span v-if="scope.row.expertLevl==2">国家</span>
						</template>
					</el-table-column>
					<el-table-column
							prop="unitAddress"
							label="单位所在地"
							width="200"
							align="center">
					</el-table-column>
					<el-table-column
							label="操作"
							width=""
							align="center">
						<template slot-scope="scope">
							<el-button size="mini" @click="view(scope.$index,scope.row)">查看专家详情</el-button>
						</template>
					</el-table-column>
				</el-table>
				<div style="overflow: hidden;">
					<div class="pagination">
						<el-pagination
								@size-change="expertHandleSizeChange"
								@current-change="expertHandleCurrentChange"
								:current-page="expertCurrentPage"
								:page-sizes="[5, 10, 15, 20]"
								:page-size="expertPagesize"
								background
								layout="total, sizes,prev, pager, next"
								:total="expertTableTotal"
								prev-text="上一页"
								next-text="下一页">
						</el-pagination>
					</div>
				</div>
			</div>
		</el-dialog>

		<!-- 专家抽取信息表 - 查看 -->
		<el-dialog title="" :visible.sync="dialogExpertViewForm" center fullscreen>
			<div style="margin-top: 10px;">

				<el-form :model="expertForm" :rules="extractrules" ref="expertForm" label-width="140px">
					<!--抽取专家信息表-->
					<el-row>
						<el-col :span="4" class="tab-title">
							抽取专家信息表
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="20">
							<el-form-item label="标题:" prop="title">
								<el-input v-model="expertForm.title" placeholder="" :disabled="expertFormDisabled" :rules="extractrules.title"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
				<div>
					<!--<el-button v-show="showAddExpert" @click="add">新增抽取条件</el-button>-->
					<!--<el-button v-show="showExpertExtract" @click="expertExtract">抽取</el-button>-->
					<el-form id="table-form" :prop="form" ref="form" :rules="extractrules" :model="form">
						<el-table ref="table" :data="form.expertTableData" border>
							<el-table-column>
								<template slot="header">
									<p>
										专业
										<span style="color:red;font-size:16px;">*</span>
									</p >
								</template>
								<template slot-scope="scope">
									<el-form-item :prop=" 'expertTableData.' + scope.$index + '.major' " :rules="extractrules.major">
										<el-select v-model="scope.row.major" placeholder="请选择专业" @keyup.native.enter="nextFocus($event,scope.row)" :disabled="expertFormDisabled">
											<el-option label="地震学" value="0"></el-option>
											<el-option label="地震地质学" value="1"></el-option>
											<el-option label="地震工程学" value="2"></el-option>
										</el-select>
										<!--<el-input v-model="scope.row.major" @keyup.native.enter="nextFocus($event,scope.row)"></el-input>-->
									</el-form-item>
								</template>
							</el-table-column>
							<el-table-column>
								<template slot="header">
									<p>
										国家级抽取比例
										<span style="color:red;font-size:16px;">*</span>
									</p >
								</template>
								<template slot-scope="scope">
									<el-form-item :prop=" 'expertTableData.' + scope.$index + '.countryRatio' " :rules="extractrules.countryRatio">
										<el-input
												v-model.number="scope.row.countryRatio"
												type="number"
												:disabled="expertFormDisabled"
												@keyup.native.enter="nextFocus($event,scope.row)"
												style="width: 90%; margin-right: 4px;"
										></el-input>%
									</el-form-item>
								</template>
							</el-table-column>
							<el-table-column v-if="extractOrgName == '中国'">
								<template slot="header">
									<p>
										省级抽取比例
										<span style="color:red;font-size:16px;">*</span>
									</p >
								</template>
								<template slot-scope="scope">
									<el-form-item :prop=" 'expertTableData.' + scope.$index + '.provinceRatio' " :rules="extractrules.provinceRatio" >
										<el-input
												v-model.number="scope.row.provinceRatio"
												type="number"
												:disabled="expertFormDisabled"
												@keyup.native.enter="nextFocus($event,scope.row)"
												style="width: 90%; margin-right: 4px;"
										></el-input>%
									</el-form-item>
								</template>
							</el-table-column>
							<template v-else>
								<el-table-column>
									<template slot="header">
										<p>
											省内抽取比例
											<span style="color:red;font-size:16px;">*</span>
										</p >
									</template>
									<template slot-scope="scope">
										<el-form-item :prop=" 'expertTableData.' + scope.$index + '.provinceRatio' " :rules="extractrules.provinceRatio">
											<el-input
													v-model.number="scope.row.provinceRatio"
													type="number"
													:disabled="expertFormDisabled"
													@keyup.native.enter="nextFocus($event,scope.row)"
													style="width: 90%; margin-right: 4px;"
											></el-input>%
										</el-form-item>
									</template>
								</el-table-column>
								<el-table-column>
									<template slot="header">
										<p>
											省外抽取比例
											<span style="color:red;font-size:16px;">*</span>
										</p>
									</template>
									<template slot-scope="scope">
										<el-form-item :prop=" 'expertTableData.' + scope.$index + '.outProvinceRatio' " :rules="extractrules.outProvinceRatio">
											<el-input
													v-model.number="scope.row.outProvinceRatio"
													type="number"
													:disabled="expertFormDisabled"
													@keyup.native.enter="nextFocus($event,scope.row)"
													style="width: 90%; margin-right: 4px;"
											></el-input>%
										</el-form-item>
									</template>
								</el-table-column>
							</template>
							<el-table-column >
								<template slot="header">
									<p>
										抽取人数
										<span style="color:red;font-size:16px;">*</span>
									</p >
								</template>
								<template slot-scope="scope">
									<el-form-item :prop=" 'expertTableData.' + scope.$index + '.regulatoryNum' " :rules="extractrules.regulatoryNum">
										<el-input
												v-model.number="scope.row.regulatoryNum"
												:disabled="expertFormDisabled"
												type="number"
												@keyup.native.enter="nextFocus($event,scope.row)"
										></el-input>
									</el-form-item>
								</template>
							</el-table-column>
						</el-table>
					</el-form>
				</div>

				<el-table :data="expertData" border style="width: 100%;margin-top: 35px;" :header-cell-style="{background:'#eef1f6',color:'#606266'}">
					<el-table-column type="selection" ></el-table-column>
					<el-table-column
							prop="expertName"
							label="专家姓名"
							width="200"
							align="center">
					</el-table-column>
					<el-table-column
							prop="major"
							label="专业"
							width="200"
							align="center">
						<template scope="scope">
							<span v-if="scope.row.major==0">地震学</span>
							<span v-if="scope.row.major==1">地震地质学</span>
							<span v-if="scope.row.major==2">地震工程学</span>
						</template>
					</el-table-column>
					<el-table-column
							prop="expertTel"
							label="联系方式"
							width="200"
							align="center">
					</el-table-column>
					<el-table-column
							prop="expertLevl"
							label="专家等级"
							width="120"
							align="center">
						<template scope="scope">
							<span v-if="scope.row.expertLevl==0">地方</span>
							<span v-if="scope.row.expertLevl==1">省级</span>
							<span v-if="scope.row.expertLevl==2">国家</span>
						</template>
					</el-table-column>
					<el-table-column
							prop="unitAddress"
							label="单位所在地"
							width="200"
							align="center">
					</el-table-column>
					<el-table-column
							label="操作"
							width=""
							align="center">
						<template slot-scope="scope">
							<el-button size="mini" @click="view(scope.$index,scope.row)">查看专家详情</el-button>
						</template>
					</el-table-column>
				</el-table>
				<div style="overflow: hidden;">
					<div class="pagination">
						<el-pagination
								@size-change="expertHandleSizeChange"
								@current-change="expertHandleCurrentChange"
								:current-page="expertCurrentPage"
								:page-sizes="[3, 10, 20, 30]"
								:page-size="expertPagesize"
								background
								layout="total, sizes,prev, pager, next"
								:total="expertTableTotal"
								prev-text="上一页"
								next-text="下一页">
						</el-pagination>
					</div>
				</div>
			</div>
		</el-dialog>

		<!-- 专家抽取任务列表 -->
		<el-dialog title="" :visible.sync="dialogExtractList" center fullscreen>
			<div style="margin-top: 10px;">
				<el-form :model="extractSelectForm" :rules="rules" ref="extractSelectForm" label-width="150px">
					<el-row>
						<el-col :span="4" class="tab-title">
							抽取专家任务列表
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="10">
							<el-form-item label="标题:" prop="" label-width="160px">
								<el-input v-model="extractSelectForm.title" placeholder="" ></el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<div style="float: right;">
							<el-button type="primary" size="small" style="width: 60px;height: 30px;" @click="searchExtractForm('extractSelectForm')">查询</el-button>
							<el-button type="warning" size="small" style="width: 60px;height: 30px;" @click="resetExtractForm('extractSelectForm')">重置</el-button>
						</div>
					</el-row>
				</el-form>
			</div>

			<el-table :data="extractData" border style="width: 100%;margin-top: 35px;" :header-cell-style="{background:'#eef1f6',color:'#606266'}">
				<el-table-column type="selection" ></el-table-column>
				<el-table-column
						prop="title"
						label="标题"
						width="300"
						align="center" >
				</el-table-column>
				<el-table-column
						prop="createTime"
						label="创建时间"
						width="200"
						align="center">
				</el-table-column>
				<el-table-column
						prop="createPerson"
						label="创建人"
						width="200"
						align="center">
				</el-table-column>
				<el-table-column
						prop="location"
						label="创建人机构"
						width="200"
						align="center">
				</el-table-column>
				<el-table-column
						label="操作"
						width=""
						align="center">
					<template slot-scope="scope">
						<el-button  size="mini" @click="extractExpertList(scope.$index,scope.row)">查看专家列表</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="overflow: hidden;">
				<div class="pagination">
					<el-pagination
							@size-change="extractHandleSizeChange"
							@current-change="extractHandleCurrentChange"
							:current-page="extractCurrentPage"
							:page-sizes="[10, 20, 30]"
							:page-size="extractPagesize"
							background
							layout="total, sizes,prev, pager, next"
							:total="extractTableTotal"
							prev-text="上一页"
							next-text="下一页">
					</el-pagination>
				</div>
			</div>
		</el-dialog>


	</div>
</div>

<script>
    var vm = new Vue({
        el: '#expertmessage',
        data() {
            //验证手机号
            let checkMobile = (rule, value, callback) => {
                if (!checkIphon(value)) {
                    callback(new Error('手机号码不合法'));
                } else {
                    callback();
                }
            };
            let checkNumber = (rule, value, callback) => {
				if(!checkNum(value)) {
				    callback(new Error('不能为负数'));
				} else {
				    callback();
				}
			};
            let checkExtractNum = (rule, value, callback) => {
                if(value <= 0) {
                    callback(new Error('必须大于0'));
				} else {
                    callback();
				}
			}
            return {
                uuid:'',
                link:'', // 附件iframe
                currentPage: 1, //默认显示页面为1
                pagesize: 10, // 每页的数据条数
                tableTotal:'',
                expertmessage: {
                    // enterpriseCreditId: '',// 表单id
                    expertId:'',
                    expertName: '',
                    expertIdcard: '',
                    expertSex: '',
                    expertSeniority: '',
                    unitAddress: '',
                    workTime: '',
                    expertLevl: '',
                    major:'',
                    unitName:'',
                    unitCode:'',
                    certype:'',
                    expertTel:'',
                    lineType:'',
                    lineStandard:'',
                    expertAddress:''
                },
                provinceValue:'',
                cityValue:'',
                areaValue:'',
                detailAddress:'',
                cityData:[],
                areaData:[],
                provinceData:[],
                formDisabled: false,
                moveInDisabled: false,
                moveOutDisabled: false,
                rules: {
                    expertName: [{
                        required: true,
                        message: '请输入专家姓名',
                        trigger: 'blur'
                    }],
                    expertIdcard: [{
                        required: true,
                        message: '请输入证件号码',
                        trigger: 'blur'
                    }],
                    certype:[{
                        required: true,
                        message: '请选择证件类型',
                        trigger: 'change'
                    }],
                    expertTel:[{
                        required: true,
                        message: '请填写联系方式',
                        trigger: 'blur'
                    },{
                        validator: checkMobile,
                        message: '请填写正确的手机号码',
                        trigger: 'blur'
                    }],
                    expertSex: [{
                        required: true,
                        message: '请选择性别',
                        trigger: 'change'
                    }],
                  /*  expertSeniority: [{
                        required: true,
                        message: '请输入专家资历',
                        trigger: 'blur'
                    }],*/
                    unitAddress: [{
                        required: true,
                        message: '请选择单位所在地',
                        trigger: 'change'
                    }],
                    workTime: [{
                        required: true,
                        message: '请选择工作时间',
                        trigger: 'change'
                    }],
                    expertLevl: [{
                        required: true,
                        message: '请选择专家等级',
                        trigger: 'change'
                    }],
                    major: [{
                        required: true,
                        message: '请选择专业类型',
                        trigger: 'change'
                    }],
                    lineType: [{
                        required: true,
                        message: '请填写行业类别',
                        trigger: 'blur'
                    }],
                    unitName: [{
                        required: true,
                        message: '请填写所在单位名称',
                        trigger: 'blur'
                    }],
                    unitCode:[{
                        required: true,
                        message: '请填写所在单位统一社会信用代码',
                        trigger: 'blur'
                    }],
                    expertAddress:[{
                        required: true,
                        message: '请填写家庭住址',
                        trigger: 'blur'
                    }],
                },

                // 证件号码校验
                idcardRules: {
                    // 居民身份证
                    111: [{ required : true, message : '证件号码必填', trigger : 'blur'},{ validator: checkId, message: '居民身份证证件号码格式错误',trigger: 'blur' }],
                    // 临时居民身份证
                    112: [{ required : true, message : '证件号码必填', trigger : 'blur'},{ validator: checkId, message: '临时居民身份证证件号码格式错误', trigger: 'blur' }],
                    // 户口簿
                    113: [{ required : true, message : '证件号码必填', trigger : 'blur'},{ validator: checkAccountCard, message: '户口簿证件号码格式错误', trigger: 'blur' }],
                    // 中国人民解放军军官证
                    114: [{ required : true, message : '证件号码必填', trigger : 'blur'},{ validator: checkOfficerCard, message: '军官证证件号码格式错误', trigger: 'blur' }],
                    // 中国人民武警警察部队警官证
                    115: [{ required : true, message : '证件号码必填', trigger : 'blur'}],
                    // 出生医学证明
                    117: [{ required : true, message : '证件号码必填', trigger : 'blur'}],
                    // 中国人民解放军士兵证
                    118: [{ required : true, message : '证件号码必填', trigger : 'blur'}],

                    // 中国人民武警警察部队士兵证
                    119: [{ required : true, message : '证件号码必填', trigger : 'blur'}],
                    // 中国人民解放军文职人员证
                    120: [{ required : true, message : '证件号码必填', trigger : 'blur'}],
                    // 中国人民武装警察部队文职人员证
                    122: [{ required : true, message : '证件号码必填', trigger : 'blur'}],

                    // 居住证
                    154: [{ required : true, message : '证件号码必填', trigger : 'blur'}],
                    // 外交护照
                    411: [{ required : true, message : '证件号码必填', trigger : 'blur'},{ validator: checkPassPortCard, message: '外交护照证件号码格式错误', trigger: 'blur' }],
                    // 公务护照
                    412: [{ required : true, message : '证件号码必填', trigger : 'blur'},{ validator: checkPassPortCard, message: '公务护照证件号码格式错误', trigger: 'blur' }],
                    // 公务普通护照
                    413: [{ required : true, message : '证件号码必填', trigger : 'blur'},{ validator: checkPassPortCard, message: '公务普通护照证件号码格式错误', trigger: 'blur' }],
                    // 普通护照
                    414: [{ required : true, message : '证件号码必填', trigger : 'blur'},{ validator: checkPassPortCard, message: '普通护照证件号码格式错误', trigger: 'blur' }],
                    // 旅行证
                    415: [{ required : true, message : '证件号码必填', trigger : 'blur'}],

                },

                dialogFormVisible: false,
                dialogForm: false,
                formInline: {
                    enterpriseName: ''
                },
                selectForm: {
                    expertName: '',
                    expertLevl: '',
                    expertIdcard: '',
                    startTime: '',
                    endTime: '',
                    isBlackList:'',
                    expertTel: ''
                },
                companyInformation: [],
                currentRow: null,
                tableData: [],
                showOnSubmit: true,
                showOnReplace: false,
                // 抽取专家信息分页
                expertCurrentPage: 1,
                expertPagesize: 5,
                expertTableTotal: '',
                expertFormDisabled: false,
                // 抽取专家信息
				expertForm: {
					id: '',
					title: ''
				},
                // 专家抽取条件增加
                inputDoms: "",
                tableIndex: 0,
                form: {
                    expertTableData: []
                },
                dialogExpertForm: false, // 专家抽取dialog
                dialogExpertViewForm : false, // 查看专家抽取dialog
                showExpertExtract: true, // 专家抽取dialog中‘抽取’按钮
                showAddExpert: true, // 新增专家抽取条件按钮

                expertData: [], // 专家抽取结果列表
				// 抽取任务信息
                extractCurrentPage: 1,
                extractPagesize: 10,
                extractTableTotal: '',
				// 抽取任务信息表
                extractSelectForm: {
					title: ''
				},
				// 抽取任务列表dialog
                dialogExtractList: false,
				// 抽取任务列表
                extractData: [],

				// 登录人信息
				orgLevel: '',
				userName: '',
				orgName: '',

				// 抽取人信息
                extractOrgName : '',
				// 抽取专家id
				extractId : '',


                extractrules: {
                    title: [{
                        required: true,
						message: '任务标题必填',
						trigger: 'blur'
					}],
					major: [{
                        required: true,
						message: '专业必填',
						trigger: 'blur'
					}],
					countryRatio: [{
                        required: true,
						message: '国家级抽取比例必填',
						trigger: 'blur'
					},{
                        validator: checkNumber,
						message: '国家级抽取比例必须为非负数',
						trigger: 'blur'
					}],
					provinceRatio: [{
                        required: true,
						message:'省抽取比例必填',
						trigger: 'blur'
					},{
                        validator: checkNumber,
						message: '省抽取比例必须为非负数',
						trigger: 'blur'
					}],
					outProvinceRatio: [{
                        required: true,
						message : '省外抽取比例必填',
						trigger: 'blur'
					},{
                        validator: checkNumber,
						message: '省外抽取比例不能为负数',
						trigger: 'blur'
					}],
					regulatoryNum: [{
                        required: true,
						message: '抽取总数必填',
						trigger: 'blur'
					},{
                        validator: checkExtractNum,
						message: '抽取总数必须大于0',
						trigger: 'blur'
					}]
				}

            }
        },
        created(){
            var userInfo = JSON.parse(localStorage.getItem('userInfo'));
            this.orgLevel = userInfo.orgLevel;
            // 中国地震局 ==> 中国, 山东省-济南市地震局 ==> 山东省-济南市
			this.orgName = userInfo.orgName.replace("地震局", "");
			this.userName = userInfo.loginName;
            axios.get('../../json/ChinaCity.json').then(res=>{
				this.provinceData = res.data;
            }).catch(e => {
                this.$message.error("网络连接超时");
            })
        },
        mounted(){
            this.getData();
        },
        methods: {
            getData() {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;
                axios({
                    method: 'get',
                    url: '/dzjap/info/listexpert',
                    params: {
                        pageSize: pagesize,
                        pageNo: pageno,
                        expertName: this.selectForm.expertName,
                        expertLevl: this.selectForm.expertLevl,
                        expertIdcard: this.selectForm.expertIdcard,
                        startTime: this.selectForm.startTime,
                        endTime: this.selectForm.endTime,
                        isBlackList: this.selectForm.isBlackList,
                        expertTel: this.selectForm.expertTel
                    }
                })
				.then(response => {
					let data = response.data;
					if (data.code == 200) {
						let dataInformation = data.page.results;
						this.tableTotal = data.page.total;// 数据长度

						this.tableData = dataInformation;

						// 证件加密
						for(let i = 0; i < dataInformation.length; i++) {
							var idCard = dataInformation[i].expertIdcard;
							if(idCard != '') {
                                var newIdcard = '';
                                newIdcard = enctryptIdcard(idCard);
                                this.tableData[i].expertIdcard = newIdcard;
                            }
						}

					} else {
						this.$message.error(data.msg);
					}
				})
				.catch(function (error) {
					console.log(error);
				})
            },
            //获取UUID的方法
            getUuid() {
                axios({
                    method: 'get',
                    url: '/dzjap/uuid/getUuid',
                })
                    .then(response => {
                    console.log(response);
                if (response.data.code == 200) {
                    this.uuid = response.data.data;
                    this.link="../upload/annex.html?uuid="+this.uuid+"&flag=1";
                } else {
                    this.$message.error(response.data.msg);
                }
            })
            .catch(function (error) {
                    console.log(error);
                });
            },
            // 表单提交
            onSubmit(expertmessage) {
                this.$refs[expertmessage].validate((valid) => {
                    if (valid) {
                        this.expertmessage.expertId = this.uuid;
                        this.expertmessage.unitAddress = this.provinceValue + "-" + this.cityValue + "-" + this.areaValue+"-"+this.detailAddress;
                        axios({
                            method: 'post',
                            url: '/dzjap/info/save',
                            data: this.expertmessage
                        })
                            .then((response) => {
                                let data = response.data;
                                if (data.code == 200) {
                                    this.dialogForm = false;
                                    this.$message({
                                        type: 'success',
                                        message: '添加成功!'
                                    });
                                    this.getData();
                                } else {
                                    this.$message.error(data.msg);
                                }
                            })
                    }else {
                        return false
                    }
                })
            },
            // 表单修改
            onReplace(expertmessage){
                this.$refs[expertmessage].validate((valid) => {
                    if(valid) {
                        this.expertmessage.unitAddress = this.provinceValue + "-" + this.cityValue + "-" + this.areaValue+"-"+this.detailAddress;
                        axios({
                            method: 'post',
                            url: '/dzjap/info/update',
                            data: this.expertmessage
                        })
                            .then((response) => {
                                let data = response.data;
                                if (data.code == 200) {
                                    this.dialogForm = false;
                                    this.$message({
                                        type: 'success',
                                        message: '修改成功!'
                                    });
                                    this.getData();
                                } else {
                                    this.$message.error(data.msg);
                                }
                            })
                    }else {
                        return false;
                    }
                })
            },
            clearForm(){
                this.showMoveOutList = false;
                this.showMoveInList = false;
                
                /*this.$nextTick(()=>{
                	this.$refs['expertmessage'].resetField();
                })*/
                this.clearFromInformation();
            },
            // 清空表单
            clearFromInformation(){
                this.expertmessage.expertName = '';
                this.expertmessage.expertIdcard = '';
                this.expertmessage.expertSex = '';
                this.expertmessage.expertSeniority = '';
                this.expertmessage.unitAddress = '';
                this.expertmessage.workTime = '';
                this.expertmessage.expertLevl = '';
                this.expertmessage.major='';
				this.expertmessage.certype='';
                this.expertmessage.unitCode='';
                this.expertmessage.unitName='';
                this.expertmessage.expertTel='';
                this.expertmessage.certype='';
                this.expertmessage.lineType='';
                this.expertmessage.lineStandard='';
                this.expertmessage.expertAddress='';
                this.provinceValue='';
				this.cityValue='';
				this.areaValue='';
				this.detailAddress='';
            },
            handleChange(value) {
                console.log(value);
            },
            apply(){
                this.dialogForm = true;
                this.showOnSubmit = true;
                this.showOnReplace = false;

                this.formDisabled = false;
                this.clearForm();
                this.getUuid();
            },
            /* 单选搜索表单 */
            selectCurrentChange(val){
                this.currentRow = val;
            },
            /* 列表页搜索 */
            searchForm(selectForm) {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;

                console.log(this.selectForm);
                axios({
                    method: 'get',
                    url: '/dzjap/info/listexpert',
                    params: {
                        pageSize: pagesize,
                        pageNo: pageno,
                        expertName: this.selectForm.expertName,
                        expertLevl: this.selectForm.expertLevl,
                        expertIdcard: this.selectForm.expertIdcard,
                        startTime: this.selectForm.startTime,
                        endTime: this.selectForm.endTime,
                        isBlackList: this.selectForm.isBlackList,
                        expertTel: this.selectForm.expertTel,
                    }
                })
                .then(response => {
                    let data = response.data;
                    if (data.code == 200) {
                        console.log(data);
                        let dataInformation = data.page.results;
                        this.tableTotal = data.page.total;// 数据长度

                        this.tableData = dataInformation;

                        // 证件号码加密
                        for(let i = 0; i < dataInformation.length; i++) {
                            var idCard = dataInformation[i].expertIdcard;
                            if(idCard != '') {
                                var newIdcard = '';
                                newIdcard = enctryptIdcard(idCard);
                                this.tableData[i].expertIdcard = newIdcard;
                            }

                        }
                    } else {
                        this.$message.error(data.msg);
                    }
                })
                .catch(function (error) {
                    console.log(error);
                });
            },
            /* 列表页重置 */
            resetForm(formName) {
                this.selectForm.expertName = '';
                this.selectForm.expertLevl = '';
                this.selectForm.expertIdcard = '';
                this.selectForm.startTime = '';
                this.selectForm.endTime = '';
                this.selectForm.isBlackList='';
                this.selectForm.expertTel = '';
           		/*this.$nextTick(() => {
               		this.$refs['selectForm'].resetField();
               	})*/

                this.getData();
            },


			/**
			 *	查询专家信息分页start
			 */
            //每页下拉显示数据
            handleSizeChange(size) {
                this.pagesize = size;
                this.getData();
            },
            //点击第几页
            handleCurrentChange(currentPage) {
                this.currentPage = currentPage;
                this.getData();
            },
            /**
             *	查询专家信息分页end
             */


            /**
             *	查询抽取专家结果分页start
             */
            //每页下拉显示数据
            expertHandleSizeChange(size) {
                this.expertPagesize = size;
				this.expertExtractList(this.extractId);
            },
            //点击第几页
            expertHandleCurrentChange(currentPage) {
                this.expertCurrentPage = currentPage;
                console.log(currentPage);
                this.expertExtractList(this.extractId);
            },
            /**
             *	查询抽取专家结果分页end
             */


            /**
             *	查询抽取专家任务分页start
             */
            //每页下拉显示数据
            extractHandleSizeChange(size) {
                this.extractPagesize = size;
                this.getExtractData(this.extractSelectForm.title);
            },
            //点击第几页
            extractHandleCurrentChange(currentPage) {
                this.extractCurrentPage = currentPage;
                this.getExtractData(this.extractSelectForm.title);
            },
            /**
             *	查询抽取专家任务分页end
             */



            // 设置允许填写和不允许填写
            checkDisabled(n){
                if(n){
                    this.formDisabled = true;
                }else{
                    this.formDisabled = false;
                }
            },
            // 删除
            del(index,row){
                this.$confirm('确定要删除吗?', '提示', {
                    cancelButtonText: '取消',
                    confirmButtonText: '确定',
                    type: 'warning'
                }).then(() => {
                    axios({
                        method: 'post',
                        url: '/dzjap/info/delConstr/' + row.expertId
                    })
                        .then(response => {
                            let data = response.data;
                            console.log(response)
                            if (data.code == 200) {
                                // 确认删除
                                this.$message({
                                    type: 'success',
                                    message: '删除成功!'
                                });
                                this.getData();
                            } else {
                                this.$message.error(data.msg);
                            }
                        })
                        .catch(function (error) {
                            console.log(error);
                        });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '取消删除'
                    });
                });
            },
            // 查看
            view(index,row){
                this.dialogForm = true;
                this.showOnReplace = false;
                this.showOnSubmit = false;
                this.showOnJoinList = false;
                this.uuid = row.expertId;
                this.link="../upload/annex.html?uuid="+this.uuid+"&flag=0";
                this.showInformation(index,row);
                this.checkDisabled(true);
            },
            // 修改
            edit(index,row){
                this.dialogForm = true;
                this.showOnReplace = true;
                this.showOnSubmit = false;
                this.showOnJoinList = false;
                this.uuid = row.expertId;
                this.link="../upload/annex.html?uuid="+this.uuid+"&flag=1";
                this.showInformation(index,row);
                this.checkDisabled(false);
            },
            // 公共方法--查看
            showInformation(index,row){
                console.log(row.expertId);
                axios({
                    method: 'post',
                    url: '/dzjap/info/findbyid/' + row.expertId
                })
				.then(response => {
					let data = response.data;
					if (data.code == 200) {
						let rowdata = response.data.apExpertEntity;
						this.clearForm(); // 重置
                        var arr = rowdata.unitAddress.split("-");
                        this.provinceValue = arr[0];
                        this.cityValue = arr[1];
                        this.areaValue = arr[2];
                        this.detailAddress=arr[3];
						this.expertmessage = rowdata;
						axios.get('../../json/ChinaCity.json').then(res=>{
		                	this.provinceData = res.data;
		                    this.provinceData.map(e=>{//遍历数据
			                    if( this.provinceValue == e.name){
				                    this.cityData = e.cityList;
				                    this.cityData.map(e=>{//遍历数据
					                    if( this.cityValue == e.name){
						                    this.areaData = e.areaList;
						                    return;
						                }
						            })
				                    return;
				                }
				            })
						}).catch(e => {
							this.$message.error("网络连接超时");
						})
					} else {
						this.$message.error(data.msg);
					}
				})
				.catch(function (error) {
					console.log(error);
				});
            },
			// 清空专家信息抽取条件
			clearExpertExtract() {
                this.expertForm.id = '';
                this.expertForm.title = '';
                this.extractOrgName = '';
                this.form.expertTableData = [];
                this.expertData = [];

			},
			// 进入专家抽取页面
            toExtract(){
				this.clearExpertExtract();
				this.extractId = "";
				this.extractOrgName = this.orgName;
                this.showExpertExtract = true;
                this.showAddExpert = true;
                this.dialogExpertForm = true;
                this.expertFormDisabled = false;

            },

            // 专家抽取结果展示
            expertExtractList(id){
                console.log("抽取方法："+id);
                axios({
                    method: 'post',
                    url: '/dzjap/expertRegulat/queryByTaskId',
                    params: {
                        pageSize: this.expertPagesize,
                        pageNo: this.expertCurrentPage,
                        taskId: id
                    }
                })
                    .then((response) => {
                        debugger;
                        let data = response.data;
                        if (data.code == 200) {
                            this.clearExpertExtract();


							this.expertForm = data.apExtractExpertEntity;
							this.extractOrgName = data.apExtractExpertEntity.location.replace("地震局", "");
                            this.dialogExpertForm = false;
							this.dialogExpertViewForm = true;
                            this.showExpertExtract = false;
                            this.showAddExpert = false;
                            this.expertFormDisabled = true;

                            this.form.expertTableData = data.apExpertRegulatorInfoEntities;
                            let dataInformation = data.apExpertEntityQueryResults.results;
                            this.expertTableTotal = data.apExpertEntityQueryResults.total;// 数据长度
                            this.expertData = dataInformation;
                        } else {
                            this.$message.error(data.msg);
                        }
                    });
            },
			// 清除专家抽取任务信息
			clearExtractForm() {
				this.extractSelectForm.title = '';
				this.extractData = [];
			},
			// 查看抽取专家任务
            toExtractList() {
                this.clearExtractForm();

                this.dialogExtractList = true;
                this.getExtractData('');
			},
			// 获取抽取任务列表
			getExtractData(title) {
                console.log(title);
                axios({
                    method: 'get',
                    url: '/dzjap/expertRegulat/queryAll',
                    params: {
                        pageSize: this.extractPagesize,
                        pageNo: this.extractCurrentPage,
						title: title
                    }
                })
                    .then(response => {
                        let data = response.data;
                        if (data.code == 200) {
                            let dataInformation = data.data.results;
                            this.extractTableTotal = data.data.total;// 数据长度

                            this.extractData = dataInformation;

                        } else {
                            this.$message.error(data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
			},
			// 根据标题查看抽取任务列表
            searchExtractForm(extractSelectForm) {
				this.getExtractData(this.extractSelectForm.title);
			},
			// 抽取任务列表重置
            resetExtractForm(extractSelectForm) {
				this.extractSelectForm.title = '';
				this.getExtractData('');
			},
			// 抽取列表中查看专家列表
            extractExpertList(index, row) {
                this.clearExpertExtract();
				this.extractId = row.id;
				this.expertExtractList(row.id);
			},
            //单位地址联动
            chooseProvince(value) {
                this.cityValue = '';
                this.areaValue = '';
                this.cityData = [];
                this.areaData = [];
                this.provinceData.map(e => {//遍历数据
                    if (value == e.name) {
                    this.cityData = e.cityList;
                    return;
                }
            })
                console.log(value)
                this.provinceValue = value;
            },
            chooseCity(value) {
                this.areaValue = '';
                this.cityData.map(e => {//遍历数据
                    if (value == e.name) {
                    this.areaData = e.areaList;
                    return;
                }
            })
                console.log(value)
                // this.areaValue = value;

            },
            chooseArea(value) {
                console.log(value)
                this.areaValue = value;
                this.expertmessage.unitAddress = this.provinceValue + "-" + this.cityValue + "-" + this.areaValue;
                console.log(this.expertmessage.unitAddress)
            },

            initInputDOM() {
                const inputDoms = document.querySelectorAll(
                    "#table-form .el-input__inner"
                );
                inputDoms.forEach((item, index) => {
                    item.setAttribute("data-index", index);
                });
                this.inputDoms = inputDoms;
            },
            nextFocus(event, row) {
                const index = event.target.getAttribute("data-index");
                const nextIndex = parseInt(index) + 1;
                const length = this.inputDoms.length;
                if (nextIndex < length) {
                    this.inputDoms[nextIndex].focus();
                } else {
                    this.inputDoms[0].focus();
                }
            },
            // 添加专家抽取条件
            add() {
                this.form.expertTableData.push({
                    id: "",
					taskId:"",
                    major: "",
                    countryRatio: "",
                    provinceRatio: "",
                    outProvinceRatio: "",
                    expertNum: ""
                });
                this.$nextTick(() => {
                    this.initInputDOM();
                });
            },
            delExtract(index) {
                this.form.expertTableData.splice(index, 1);
            },
            // 抽取专家
            expertExtract() {
                this.$refs.form.validate(valid => {
                    if (valid) {
                        axios({
                            method: 'post',
                            url: '/dzjap/expertRegulat/extract',
							params:  {
                                title: this.expertForm.title,
                            },
							data:  this.form.expertTableData

                        })
						.then((response) => {
							let data = response.data;
							console.log(data);
							if (data.code == 200) {
							    this.extractId = data.taskId;
								this.expertExtractList(data.taskId);
								this.getData();
							} else {
								this.$message.error(data.msg);
							}
						});
                    }
                });
            },

            changeIdcardRule(data) {

                // if(this.expertmessage.certype == '111' ) {
                //     this.idcardLength = 18;
                // }

                // 将值清空
                this.expertmessage.expertIdcard = '';
                // 去除证件号码的格式校验
                this.$refs.expertIdcard.clearValidate();
                // 给表单加上新的校验
                this.rules.expertIdcard = this.idcardRules[data];
            }
        }
    })
</script>
</body>
</html>